package com.anlu.paypal.common;

import io.swagger.models.auth.In;

import java.io.Serializable;

public class ResponseData implements Serializable {

    private Integer code;
    private String msg;
    private Object data;

    public ResponseData(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResponseData() {
    }

    public static ResponseData ok(Object data){
        return makeResult(200,"success",data);
    }

    private static ResponseData makeResult(Integer code, String msg, Object data) {
        ResponseData result = new ResponseData();
        result.setCode(code);
        result.setMsg(msg);
        if (data != null) {
            result.setData(data);
        }
        return result;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
